package org.gruposp2p.proyectokarma.gwt.client.cometd.ui;

import java.util.HashMap;
import java.util.Map;
import org.cometd4gwt.client.CometdClient;
import org.cometd4gwt.client.CometdClientImpl;
import org.cometd4gwt.client.ConnectionConfig;
import org.cometd4gwt.client.PersistentSubscribersCometdClient;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
import com.allen_sauer.gwt.log.client.Log;

public class ChannelPanel extends Composite {

    private static ChannelPanelUiBinder uiBinder =
    	GWT.create(ChannelPanelUiBinder.class);

    interface ChannelPanelUiBinder extends UiBinder<Widget, ChannelPanel> { }

    @UiField Button joinToGroup;
    @UiField Button leaveGroup;
    @UiField Button sendMessageToGroup;
    @UiField TextBox messageToSend;
    @UiField TextBox messageToSendSubject;
    @UiField HTML status;
    @UiField TextBox groupToJoin;
    @UiField TextBox groupToLeave;
    @UiField TextBox peerFrom;
    @UiField TextBox peerTo;
    boolean connected;
    private ConnectionConfig connectionConfig;



	private Map<String, JavaScriptObject> subscriptions = new HashMap<String, JavaScriptObject> ();

    public ChannelPanel() {
    	initWidget(uiBinder.createAndBindUi(this));
    }

    public void setStatusMessage (String message) {
    	status.setHTML(message);
    }

    @UiHandler("sendMessageToGroup")
    void handleSendMessageToGroup(ClickEvent e) { }


}